package com.ogawa.a7517.fragment;

import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.ogawa.a7517.R;
import com.ogawa.a7517.bean.DeviceStateBean;
import com.ogawa.a7517.bean.MassageArmchair;

public class FaultFragment extends BaseFragment {
    private TextView tvFault;

    @Override
    public int getLayoutId() {
        return R.layout.fragment_fault;
    }

    @Override
    public void initView(View view) {
        view.findViewById(R.id.iv_back).setOnClickListener(view1 -> {
            activity7517.popBackStack();
        });
        tvFault = view.findViewById(R.id.tv_fault_result);
        String fault = MassageArmchair.getInstance().getFault();
        if (!TextUtils.isEmpty(fault)){
            tvFault.setText(fault);
        }
    }

    @Override
    public void deviceStateChange() {
        super.deviceStateChange();
        String fault = MassageArmchair.getInstance().getFault();
        if (!TextUtils.isEmpty(fault)){
            tvFault.setText(fault);
        }
    }
}
